package com.dlut.java2;

import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

/**
 * @Author: LiuHeng  18
 * @Description:
 * @Date: 2022-09-13 19:53
 */
public class T0913_microBank {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        if (m<3){
            System.out.println(0);
        }
        else if (n == 3){
            System.out.println(cFun(m,3));
        }
    }

    private static int cFun(int n, int m) {
        int k1 = n, k2 = 1, ans = 1;
        for (int i = 0; i < m; i++) {
            ans = ans * k1 / k2;
            k1--;
            k2++;
        }
        return ans;
    }


    /**
     * 第二题
     */
    /*
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        long a,b;
        for (int i = 0; i < t; i++) {
            long t1 = in.nextLong();
            long t2 = in.nextLong();
            a = Math.max(t1,t2);
            b = Math.min(t1,t2);
            int count = 0;
            boolean flag = false;
            while (a > b){
                if ((a&1) == 0){
                    a = a >> 1;
                    count++;
                }else {
                    flag = true;
                    break;
                }
            }
            if (a != b || flag){
                System.out.println(-1);
            }else
                System.out.println((count + 2) / 3);
        }
    }
    */

    /**
     * 拼接数字
     * n个数字，选出3个拼成最大数字
     */
    /*
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        in.nextLine();
//        int n = in.nextInt();
        String s = in.nextLine();
        String[] numstr = s.split(" ");
        Arrays.sort(numstr, new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                int n1 = o1.length();
                int n2 = o2.length();
                if (n1 != n2){
                    return n2 -n1;
                }
                for (int i = 0; i < n1 + n2; i++) {
                    char c1 = o1.charAt(i % n1);
                    char c2 = o2.charAt(i % n2);
                    if (c1 != c2){
                        return c2 - c1;
                    }
                }
                return 0;
            }
        });
        String[] arr = new String[3];
        arr[0] = numstr[0];
        arr[1] = numstr[1];
        arr[2] = numstr[2];
        Arrays.sort(arr, new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                int n1 = o1.length();
                int n2 = o2.length();
                for (int i = 0; i < n1 + n2; i++) {
                    char c1 = o1.charAt(i % n1);
                    char c2 = o2.charAt(i % n2);
                    if (c1 != c2){
                        return c2 - c1;
                    }
                }
                return 0;
            }
        });
        for (int i = 0; i < 3; i++) {
            System.out.print(arr[i]);
        }
    }
    */

}
